package com.synnex.mobile.servier.core.survey.bo;

import com.synnex.mobile.generic.core.util.ObjectUtil;
import com.synnex.mobile.servier.core.contact.dto.Contact;
import com.synnex.mobile.servier.core.survey.dto.Questionnaire;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-8-10
 * Time: 上午9:51
 * To change this template use File | Settings | File Templates.
 */
public class QuestionnaireBo {
    private Integer id;
    private String title;
    private String creater;
    private String desc;
    private Integer seq;

    private Date entryDate;
    private Date updateDate;

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Date getEntryDate() {
        return entryDate;
    }

    public void setEntryDate(Date entryDate) {
        this.entryDate = entryDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public static QuestionnaireBo  createInstance(Questionnaire questionnaire){

        if(questionnaire!=null){
            return ObjectUtil.copyProperties(questionnaire, QuestionnaireBo.class);
        }else{
            return new QuestionnaireBo();
        }
    }

    public static List<QuestionnaireBo> createInstance(List<Questionnaire> datas){

        List<QuestionnaireBo> questionnaireBos = new ArrayList<QuestionnaireBo>();
        if (datas != null) {
            for (Questionnaire data : datas) {
                questionnaireBos.add(createInstance(data));
            }
        }
        return questionnaireBos;
    }
}
